package myJlite.plugin;

import jvlite.mvc.annotaion.Insert;
import jvlite.mvc.annotaion.Part;
import jvlite.plugin.IPlugin;
import jvlite.plugin.mybatis.MyBatisSessionMgr;
@Part
public class MyBatisPlugin implements IPlugin{
	
	@Insert(value = "myBatisSessionMgr")
	public MyBatisSessionMgr myBatisSessionMgr;

	@Override
	public Boolean initialize() {
		try {
//			JLiteContext.myBatisSessionMgr.initialize();
//			LogKit.info(BeanFactory.getDIMap().toString());
			myBatisSessionMgr.initialize();
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
		return true;
	}

	@Override
	public Boolean install() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Boolean uninstall() {
		try {
			myBatisSessionMgr.unInitialize();
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
		return true;
	}

	@Override
	public Boolean destroy() {
		// TODO Auto-generated method stub
		return null;
	}

}
